﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="MYSMRM.Model" namespace="MYSMRM.Model">

  <class name="QSTopic" table="QS_TOPIC">
    <cache usage="read-write"/>
    <id name="ID" type="int">
      <column name="I_ID" index="PK_QS_TOPIC"/>
      <generator class="identity" />
    </id>

    <property name="Title" type="String">
      <column name="S_TITLE" not-null="false"/>
    </property>

    <property name="StartDate" type="DateTime">
      <column name="D_START_DATE" not-null="false"/>
    </property>

    <property name="EndDate" type="DateTime">
      <column name="D_END_DATE" not-null="false"/>
    </property>

    <property name="AutoClose" type="bool">
      <column name="B_AUTO_CLOSE" not-null="false"/>
    </property>

    <property name="Anonymity" type="bool">
      <column name="B_ANONYMITY" not-null="false"/>
    </property>

    <property name="SendEmail" type="bool">
      <column name="B_SEND_EMAIL" not-null="false"/>
    </property>

    <property name="EmailAddress" type="String">
      <column name="S_EMAIL_ADDRESS" not-null="false"/>
    </property>

    <property name="Creator" type="String">
      <column name="S_CREATOR" not-null="false"/>
    </property>

    <property name="CreateDate" type="DateTime">
      <column name="D_CREATE_DATE" not-null="false"/>
    </property>

    <bag name="QuestionList" inverse="true" cascade="all-delete-orphan" table="QS_Question">
      <key column="I_TOPIC_ID" foreign-key="FK_QS_Question_QS_TOPIC"/>
      <one-to-many class="MYSMRM.Model.QSQuestion, MYSMRM.Model" />
    </bag>
  </class>

</hibernate-mapping>